unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,turniertools, DB, ZAbstractRODataset, ZAbstractDataset, ZDataset,
  DBCtrls, StdCtrls, Spin;

type
  TForm5 = class(TForm)
    homeCB: TDBLookupComboBox;
    homeCCB: TZQuery;
    homeCDS: TDataSource;
    guestCCB: TZQuery;
    guestCDS: TDataSource;
    guestCB: TDBLookupComboBox;
    stageQuery: TZQuery;
    stageQueryDS: TDataSource;
    stageCB: TDBLookupComboBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    speichernB: TButton;
    Label4: TLabel;
    matchdayE: TSpinEdit;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure speichernBClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form5: TForm5;

implementation

{$R *.dfm}

uses Unit1,Unit3,Unit4;

procedure TForm5.FormCreate(Sender: TObject);
begin
//createSqlMatchCombinationStr
end;

procedure TForm5.FormShow(Sender: TObject);
var query:string;
begin
query:=createSqlMatchCombinationStr(IntToStr(turnier.id));
homeCCB.SQL.Clear;
guestCCB.SQL.Clear;
homeCCB.SQL.Add(query);
guestCCB.SQL.Add(query);
homeCCB.Active:=true;
guestCCB.Active:=true;
end;

procedure TForm5.speichernBClick(Sender: TObject);
begin
  addMatch( homeCb.KeyValue,guestCB.KeyValue,stageCB.KeyValue,turnier.id,
            matchdayE.value,Form1.matches);
  close;
  Form4.queryMatch.Refresh;
end;

end.
